package com.bullsora.kindlerss.web.mvc;

import com.bullsora.kindlerss.business.FeedService;
import com.bullsora.kindlerss.business.SubscriptionsService;
import com.bullsora.kindlerss.model.Subscription;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.roo.addon.web.mvc.controller.scaffold.RooWebScaffold;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@RequestMapping("/subscriptions")
@Controller
@RooWebScaffold(path = "subscriptions", formBackingObject = Subscription.class)
public class SubscriptionController {
  
    @Autowired FeedService feedService;
      
   void populateEditForm(Model uiModel, Subscription subscription) {
        uiModel.addAttribute("subscription", subscription);
        addDateTimeFormatPatterns(uiModel);
//        uiModel.addAttribute("appusers", appUserService.findAllAppUsers());
        uiModel.addAttribute("feeds", feedService.findAllFeeds());
    }
}
